#include "CircleQueTimer.h"
#include <iostream>
#include <windows.h>
int main()
{
	::srand(time(NULL));
	CircleQueTimer<int> timer(10);
	while (1)
	{		
		if (timer.is_exist())
		{
			unordered_set<int> ret = timer.getCurr();
			for (auto& t : ret)cout << t << ' ';
			cout << endl;
			timer._erase(ret);
			break;
		}

		int v = ::rand() % 18;
		cout << "端口" << v << ' ';
		timer.insert(v);

		v = ::rand() % 100;
		cout << v <<' ';
		timer.insert(v);
		
		v = ::rand() % 18;
		cout << v << endl;
		timer.insert(v);
		
		timer._step();
		Sleep(1000);
	}
}